package sg.edu.nus.iss.billing.gui;

//Tan Pic Cheng

import java.awt.Dimension;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

import sg.edu.nus.iss.billing.entity.Customer;
import sg.edu.nus.iss.billing.localization.MessageKeyManager;

public class ViewCustomerMiscPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

private String[] labelContent = {MessageKeyManager.getMessage("label.interests")}; 
	
	private JLabel lblCustHeader;
	private JLabel lblInterests;
		
	private JLabel lblShowCustInterests;
	
	private Customer customer;
	
	private int labelHeight = 20;
	private int labelWidth = 200;
	private int fieldControlX = 150;
	private int lblControlX = 10; 

	public ViewCustomerMiscPanel(Customer customer) {
	// TODO Auto-generated constructor stub
		super();
		init();
		this.customer = customer;
		lblShowCustInterests.setText(customer.getInterests());			
	}
	private JLabel createLabel(String labelContents, int x, int y){
		
		JLabel labelName = new JLabel(labelContents);
		labelName.setVerticalTextPosition(SwingConstants.BOTTOM);
		labelName.setBounds(x, y, labelWidth, labelHeight);
		add(labelName);		
		
		return labelName;
		
	}
	private void init() {
		// TODO Auto-generated method stub
		setLayout(null);
		setPreferredSize(new Dimension(400,300));
		setBounds(400 , 400, 400, 300);
		
		lblCustHeader = createLabel("Miscellaneous", 10, 5);
		
		int controly = 40;
			
		for(int i = 0; i < labelContent.length; i++){
			
			switch(i){			
			case 0: lblInterests = createLabel(labelContent[i], lblControlX, controly);
					lblShowCustInterests = createLabel("", fieldControlX, controly);
					break;
			}//End of Switch
			
			controly = controly + 35;
			
		}//End of For

	}

}
